import request from '@/utils/request'

// 查询收藏表列表
export function listCollection(query) {
  return request({
    url: '/system/collection/list',
    method: 'get',
    params: query
  })
}

// 查询收藏表详细
export function getCollection(id) {
  return request({
    url: '/system/collection/' + id,
    method: 'get'
  })
}
// 根据userid查询收藏表详细
export function getCollectionByUserId(userId) {
  return request({
    url: '/system/collection/list/' + userId,
    method: 'get'
  })
}

// 新增收藏表
export function addCollection(data) {
  return request({
    url: '/system/collection',
    method: 'post',
    data: data
  })
}

// 修改收藏表
export function updateCollection(data) {
  return request({
    url: '/system/collection',
    method: 'put',
    data: data
  })
}

// 删除收藏表
export function delCollection(id) {
  return request({
    url: '/system/collection/' + id,
    method: 'delete'
  })
}
//根据信息删除对应项的收藏
export function delCollectionInfo(data) {
  return request({
    url: '/system/collection/info' ,
    method: 'delete',
    data:data
  })
}
